﻿using LtccApi.Models;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace LtccApi.Controllers
{
    /// <summary>
    /// 胎宽面
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class TkmController : Controller
    {
        private LtccContext mLtccContext;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="ltccContext"></param>
        public TkmController(LtccContext ltccContext)
        {
            mLtccContext = ltccContext;
        }

        /// <summary>
        /// 胎宽面数据
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult List()
        {
            List<TireSizeSearch> listData = mLtccContext.TireSizeSearchs.Where(m => m.Type == "1").OrderBy(m => m.Value).ToList();
            return Ok(listData);
        }
    }
}
